package main

import (
	"fmt"
	"github.com/gin-gonic/gin"
	"task-server-gin/cfg"
	"task-server-gin/routers"
)

func main() {

	// 发布版本
	//gin.SetMode(gin.ReleaseMode)
	r := gin.Default()

	// 注册路由
	routers.TaskRouterInit(r)

	r.GET("/ping", func(c *gin.Context) {
		c.String(200, "Pong")
	})
	fmt.Println("http://localhost:25001")
	err := r.Run(cfg.SERVER_PORT)
	if err != nil {
		fmt.Println("start server catch error=", err.Error())
	}
}
